"""(re)Initial

Revision ID: 350332a6d5dd
Revises: 
Create Date: 2023-03-29 14:06:07.176070

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = '350332a6d5dd'
down_revision = None
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('admin_user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email', sa.String(length=100), nullable=True),
    sa.Column('password', sa.String(length=100), nullable=True),
    sa.Column('name', sa.String(length=100), nullable=True),
    sa.Column('is_super_admin', mysql.TINYINT(display_width=1), server_default='0', nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('messages',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('text', sa.String(length=700), nullable=True),
    sa.Column('answer', sa.String(length=1000), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('text')
    )
    op.create_table('stats',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('days', sa.DATE(), nullable=True),
    sa.Column('accounts', sa.Integer(), server_default='0', nullable=True),
    sa.Column('likes', sa.Integer(), server_default='0', nullable=True),
    sa.Column('comments', sa.Integer(), server_default='0', nullable=True),
    sa.Column('documents', sa.Integer(), server_default='0', nullable=True),
    sa.Column('uniques', sa.Integer(), server_default='0', nullable=True),
    sa.Column('whitepages', sa.Integer(), server_default='0', nullable=True),
    sa.Column('dolphin_accs', sa.Integer(), server_default='0', nullable=True),
    sa.Column('messages_distribution', sa.Integer(), server_default='0', nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('days')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('telegram_id', mysql.BIGINT(), nullable=True),
    sa.Column('is_active', mysql.TINYINT(display_width=1), server_default='1', nullable=False),
    sa.Column('balance', sa.Integer(), server_default='0', nullable=True),
    sa.Column('accounts_added', sa.Integer(), server_default='0', nullable=True),
    sa.Column('likes', sa.Integer(), server_default='0', nullable=True),
    sa.Column('comments', sa.Integer(), server_default='0', nullable=True),
    sa.Column('uniques', sa.Integer(), server_default='0', nullable=True),
    sa.Column('documents_generated', sa.Integer(), server_default='0', nullable=True),
    sa.Column('whitepages_generated', sa.Integer(), server_default='0', nullable=True),
    sa.Column('dolphin_accs_loaded', sa.Integer(), server_default='0', nullable=True),
    sa.Column('linked_shop', mysql.TINYINT(display_width=1), server_default='0', nullable=False),
    sa.Column('capmonster_token', sa.String(length=100), nullable=True),
    sa.Column('capmonster_url', sa.String(length=100), nullable=True),
    sa.Column('kopeechka_token', sa.String(length=100), nullable=True),
    sa.Column('was_registered', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.Column('last_activity', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('db_profile_fb_dolphin',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('area', sa.String(length=50), nullable=True),
    sa.Column('customer', sa.Integer(), nullable=True),
    sa.Column('Name', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('login', mysql.VARCHAR(length=50), nullable=False),
    sa.Column('password', mysql.VARCHAR(length=50), nullable=False),
    sa.Column('proxy', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('useragent', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('status', sa.Enum('sliv', 'call_friends', 'ADS', 'update', 'invite', 'checkpoint', 'zagruzil selfy', 'disable', 'zagruzil doki', 'message', 'telephone', 'tapto', 'recaptcha', 'bad_mail', 'bad_phone', 'email_update', 'bad_pass', 'changePass', 'selfy', 'selfy_not_load', 'worm', 'friends', 'wait_aproove', 'bad_login', 'err_send_mes_mail', 'zrd', 'zrd_plus', 'zrd_plus_up', 'zrd_bm', 'ads_block', 'zrd_plus_bm', 'bm', 'zrd_plus_bm_not_aproove', 'worm_bm_not_aproove', 'worm_bm_aproove', 'back_from_store'), server_default=sa.text("'worm'"), nullable=True),
    sa.Column('status_execute', sa.Enum('busy', 'done'), server_default=sa.text("'busy'"), nullable=True),
    sa.Column('token', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('Cookies_multilogin', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('link_img', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('phone', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('instagram', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('city', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('fanpage', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('Friends', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('ID_akk', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('email', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('passMail', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('kopeechka_id', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('linksSelfy', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('col_selfy', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('col_doki', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('col_post', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('col_phone', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('workchecpoint', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('token_bm', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('id_bm', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('link_bm', sa.String(length=255), server_default=sa.text("''"), nullable=False),
    sa.Column('doc_link', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('col_change_pass', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('col_get_tel', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('col_checkpoint', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('count_bm', sa.Integer(), server_default=sa.text("'0'"), nullable=False),
    sa.Column('ads_block', mysql.TINYINT(display_width=1), server_default=sa.text("'0'"), nullable=False),
    sa.Column('created_at', mysql.TIMESTAMP(), server_default=sa.text('now()'), nullable=True),
    sa.Column('updated_at', mysql.TIMESTAMP(), server_default=sa.text('now()'), nullable=True),
    sa.Column('activity_status', mysql.TINYINT(display_width=1), server_default=sa.text("'1'"), nullable=False),
    sa.Column('result_mes', mysql.MEDIUMTEXT(), nullable=True),
    sa.ForeignKeyConstraint(['customer'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('documents',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('customer', sa.Integer(), nullable=True),
    sa.Column('fullname', sa.String(length=50), nullable=True),
    sa.Column('city', sa.String(length=50), nullable=True),
    sa.Column('status', sa.Enum('busy', 'done'), server_default=sa.text("'busy'"), nullable=True),
    sa.Column('img', sa.String(length=50), nullable=True),
    sa.ForeignKeyConstraint(['customer'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('id_accounts',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('customer', sa.Integer(), nullable=True),
    sa.Column('status', sa.Enum('busy', 'done'), server_default=sa.text("'busy'"), nullable=True),
    sa.Column('ID_akk', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('result_mes', mysql.MEDIUMTEXT(), nullable=True),
    sa.ForeignKeyConstraint(['customer'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('tasks',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('type', sa.String(length=50), nullable=True),
    sa.Column('customer', sa.Integer(), nullable=True),
    sa.Column('status', sa.Enum('busy', 'done'), server_default=sa.text("'busy'"), nullable=True),
    sa.Column('link', sa.String(length=500), nullable=True),
    sa.Column('count_done', sa.Integer(), server_default='0', nullable=True),
    sa.Column('count_work', sa.Integer(), server_default='0', nullable=True),
    sa.Column('text', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('time_interval', sa.Integer(), server_default='0', nullable=True),
    sa.Column('last_used', mysql.TIMESTAMP(), server_default=sa.text('now()'), nullable=False),
    sa.ForeignKeyConstraint(['customer'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('uniques',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('customer', sa.Integer(), nullable=True),
    sa.Column('status', sa.Enum('busy', 'done'), server_default=sa.text("'busy'"), nullable=True),
    sa.Column('file_path', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['customer'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('whitepages',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('customer', sa.Integer(), nullable=True),
    sa.Column('status', sa.Enum('busy', 'done'), server_default=sa.text("'busy'"), nullable=True),
    sa.Column('white_link', sa.String(length=255), nullable=True),
    sa.Column('white_login', sa.String(length=50), nullable=True),
    sa.Column('white_pass', sa.String(length=50), nullable=True),
    sa.ForeignKeyConstraint(['customer'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('whitepages')
    op.drop_table('uniques')
    op.drop_table('tasks')
    op.drop_table('id_accounts')
    op.drop_table('documents')
    op.drop_table('db_profile_fb_dolphin')
    op.drop_table('user')
    op.drop_table('stats')
    op.drop_table('messages')
    op.drop_table('admin_user')
    # ### end Alembic commands ###
